#{extends 'CRUD/layout.html' /}
#{set 'moreStyles'}
    <link rel="stylesheet" type="text/css" media="screen"  href="@{'/public/stylesheets/treeview/jquery.treeview.css'}" />
#{/set}
#{set 'moreScripts'}
	<script src="@{'/public/javascripts/jquery.cookie.js'}" type="text/javascript" charset="utf-8"></script>
	<script src="@{'/public/javascripts/jquery.treeview.js'}" type="text/javascript" charset="utf-8"></script>


	<script type="text/javascript">
	$(document).ready(function(){
		$("#productTypeTree > ul").treeview({persist: "cookie"});
	});
	

	</script>
#{/set}

<div id="crudList" class="${type.name}">
	
	<h2 id="crudListTitle">&{'crud.list.title', type.name}</h2>

	<div id="crudListSearch">
	</div>
		
	<div id="onAsyncErrorNode"></div>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="180" valign="top">
				<div id="productTypeTree">
					${productTree.raw()}
				</div>
			</td>
			<td valign="top">
				<div id="crudContent" style="padding:0px;">
				<div id="crudListTable">
					#{crud.table fields:['name','priority','showInHomepage','creator','createTime','modifier','updateTime'],sort:' '}
					
						#{crud.custom 'name'}
						<a href="@{Products.show(object.id)}">${object.name}</a>
						<a href="@{Application.overview(object.id)}" target="_blank">查看</a>
						#{/crud.custom}
						#{crud.custom 'showInHomepage'}
							%{ if(object.showInHomepage){  }%
								<font color="red">是</font>
							%{ }else{ }%
								否
							%{ } }%
							
						#{/crud.custom}
					#{/crud.table}
				</div>
				<div id="crudListPagination">
					#{crud.pagination /}
				</div>
				</div>
			</td>
		</tr>
	</table>
	
	
	<div id="crudListTool">
		<a href="@{blank(productTypeId)}">&{'crud.add', type.modelName}</a>
	</div>
	
	

</div>
